{%extends "base.html"%}
{%block body%}
<script type="text/javascript" src="/static/tinymce/tiny_mce.js"></script>
<script type="text/javascript" src="/static/script.js"></script>
<script type="text/javascript"><!--
tinyMCE.init({
                                  mode : "textareas",
                                  theme : "advanced"
});
--></script>
<div id="entry_edit">

<form action="{%url views.edit entry.key.id%}" method="post">
<fieldset>

 <legend>Post or Edit Entry</legend>

<div class="span-10 colborder">
<p><label for="id_name">Title</label><br />
  <input type="text" class="title" name="name" id="id_name" value="{{entry.name}}" />
</p>

<p><label for="id_description">Content</label> <a href=# onClick=showMCE('id_description',this);>[hide editor]</a><br />
  <textarea name="description" id="id_description" rows="5" cols="25">{{entry.description}}</textarea>
</p>

</div>
<script>
$(document).ready(function(){
$("input.showurl").click(function(){ $("p.url:hidden").slideDown("slow"); });

$("input.hiddenurl").click(function(){ $("p.url:visible").slideUp("slow"); });
});

</script>

<div class="span-6 last">
<p><label for="id_type">Type</label><br />
	<input name="type" type="radio" {%ifnotequal entry.type 2%}checked{%endifnotequal%} value="1" class="hiddenurl">Blog Entry</option>
	<input name="type" type="radio" {%ifequal entry.type 2%}checked{%endifequal%} value="2" class="showurl">Single Page</option>
</p>

<p class="url" {%ifnotequal entry.type 2%}style="display: none;"{%endifnotequal%}><label for="id_url">Url</label><br />
	<input type="text" class="text edit_right_input" name="url" id="id_url" value="{%if entry.url%}{{entry.url}}{%endif%}" />
</p>

<p><label for="id_tags">Tags</label><br />
<input type="text" class="text edit_right_input" name="tags" id="id_tags" value="{%if entry.tags%}{{entry.tags}}{%endif%}" />
</p>
</div>

<hr />
<div>
<p class="submit"><input type="submit" value="Create or Edit Entry" /> <input type="reset" value="Reset" /></p>
</div>


</fieldset>
</form>

</div>
{%endblock%}
